package com.quxiu.system.mapper;

import java.util.List;
import com.quxiu.system.domain.BpmProcActor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 审批流程参与者Mapper接口
 *
 * @author quxiu
 * @date 2024-06-14
 */
@Mapper
public interface BpmProcActorMapper {
    int insert(BpmProcActor bpmProcActor);

    /**
     * 修改处理状态
     * @param procInstId 审批流程实例id
     * @param type 类型
     * @param userId 用户id
     * @param handleStatus 处理状态
     * @return
     */
    int updateHandleStatus(@Param("procInstId") Long procInstId, @Param("type") String type,
                           @Param("userId") Long userId, @Param("handleStatus") String handleStatus);

    int delete(@Param("procInstId") Long procInstId, @Param("type") String type, @Param("userId") Long userId);

    BpmProcActor select(@Param("procInstId") Long procInstId, @Param("type") String type, @Param("userId") Long userId);

    int update(BpmProcActor actor);

    /**
     * 获取待审批人列表
     * @param procInstId
     * @return
     */
    List<BpmProcActor> selectPendingApprovalActors(@Param("procInstId") Long procInstId);

    Integer countNum(@Param("userId") Long userId, @Param("type") String type, @Param("handleStatus") String handleStatus);
}
